The following example is from the Do While command button:
Private Sub cmdDoWhile_Click ()
Dim intNumber As Integer
Cls
intNumber = 1 Do While intNumber < 10 Print intNumber
intNumber = intNumber + 1 Loop End Sub
While . . . Wend
The While...Wend loop is exactly the same as the Do While loop. Its not used too much anymore, but in previous versions of the BASIC language, it was used quite a lot. Therefore, Visual Basic includes this syntax to maintain backward compatibility. This construct is actually not even in the help anymore which means Visual Basic will probably not support it in a future version. Heres the syntax:
While <Cond>
<Statement Block>
Wend
The following example is from the While/Wend command button:
Private Sub cmdWhileWend_Click ()
Dim intNumber As Integer
Cls
intNumber = 1 While intNumber < 10 Print intNumber
intNumber = intNumber + 1 Wend End Sub